//
//  CXSampleService.m
//  Codex
//
//  Created by ChenJie on 01/02/2018.
//  Copyright © 2018 Mist. All rights reserved.
//


#import "CXSampleService.h"
#import "CXWebDriver.h"

@implementation CXSampleService

- (NSURLSessionDataTask *)loginWithUsername:(NSString *)username
                                   password:(NSString *)password
                                    success:(WebDriverSuccessCallback)success
                                    failure:(WebDriverFailureCallback)failure {
    NSString *loginUrl = @"http://appdemo.outsourceax.net:33084/Api/OadCarSerAPPApi.asmx/userLogin";
    
    NSDictionary *loginParameters
    = @{
        @"userName": username,
        @"passWord": password,
        };
    
    return [self post:loginUrl parameters:loginParameters success:^(id response) {
        !success ?: success(response);
    } failure:^(NSError *error) {
        !failure ?: failure(error);
    }];
}

@end
